<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Cache-Control" content="no-store"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link type="text/css" rel="stylesheet" href="../../statics/themes/mobile/style.css" />
	<script src="../../statics/scripts/jquery.js"></script>
	<script src="../../statics/scripts/common.js"></script>
	<script type="text/javascript" src="../../portal/scripts/plugin.js"></script>
	<script src="../../statics/scripts/plugins/dialog/jquery.dialog.js"></script>
	
	<script type="text/javascript">
		var menuName = window.top.Portal.config.params.title ;
	
		$(function(){
			$('#menu_name').focus().keydown(function(){ 
				event.keyCode==13 && $('#saveButton').click(); 
			})
			
			jQuery('#menu_name').val(menuName) ;
		
			$('#closeButton').click( function(){
				$(this).dialogClose();
			} ) ;
			
			$('#saveButton').click( function(){
				var menuName = $('#menu_name').val().replace(/[ ]/g,"") ;
				if(!menuName){
					$('#menu_name').val(menuName);
					$('#menu_name').get(0).focus();
					alert('请输入页面名称！') ;
					return ;
				}
				
				//需要判断菜单名称中是否存在特殊字符
				if(! /^[^@\/\'\\\"#$%&<>\^\*]+$/.test( menuName )) {
					alert("您输入的页面名称中包含有以下特殊字符[^@\/\'\\\"#$%&<>\^\*]，请重新输入") ;
					return ;
				}

				window.top.Portal.config.dialog.callback( 
					{ title:$.trim(menuName) } //, pluginCode:$('#pluginCode').val()
				) ;//$.trim(menuName)
			} ) ;
		}) ;

		
	</script>
</head>

<body  style="width:99%;" >
		<div  style="height:195px; text-align: center;margin:0px;padding:0px;">
		<table width="100%" height="100%" border="0" style="margin:0px;padding:0px;" cellspacing="0" cellpadding="0">
			<tr>
				<td align=left valign=bottom id=d_c_title>
					<b>&nbsp;&nbsp;&nbsp;&nbsp;页面名称：</b>
				</td>
			</tr>
			<tr>
				<td valign=top style="padding-top:5px;" id=d_c_content>
					<input name="textfield" id="menu_name" maxlength="20" type="text" style="width:250px;height:22px;font:11pt;padding-top:3px;"/>
				</td>
			</tr>
			<!-- 
			<tr>
				<td align=left valign=bottom id=d_c_title>
					<b>&nbsp;&nbsp;&nbsp;&nbsp;页面类型：</b>
				</td>
			</tr>
			<tr>
				<td valign=top style="padding-top:5px;" id=d_c_content>
					<select id="pluginCode" name="pluginCode" style="width:250px;height:25px;font:11pt;padding-top:3px;">
						<option value="">--选择页面类型--</option>
					</select>
				</td>
			</tr>
			 -->
			<tr>
				<td align="right">
					<a href="#" id="saveButton"  class="combtn btn btn-primary" >保存</a>
					<a href="#" id="closeButton" class="combtn btn">关闭</a>
				</td>
			</tr>
		</table>
		
	    <script type="text/javascript">
			var plugins = window.top.Portal.services.getPageCreator() ;
			$(plugins).each( function(){
				$("#pluginCode").append("<option value='"+this.code+"'>"+this.title+"</option>") ;
			} ) ;
	    </script>
</body>
</html>
